package org.greatlogic.gwtfilereaderwidget.client.itunes;

import com.google.gwt.event.shared.EventHandler;
import com.google.web.bindery.event.shared.Event;
import java.util.TreeSet;
import org.greatlogic.gwtfilereaderwidget.client.itunes.ITunesEnums.EITunesEventType;
import org.greatlogic.gwtfilereaderwidget.client.itunes.ITunesEvent.IITunesEventHandler;

public class ITunesEvent extends Event<IITunesEventHandler> {
//--------------------------------------------------------------------------------------------------
public static final Type<IITunesEventHandler> ITunesEventType = new Type<IITunesEventHandler>();

private int                                   _completedCount;
private EITunesEventType                      _eventType;
private String                                _message;
private int                                   _targetCount;
private static TreeSet<String>                _unknownKeyDataTypeSet;
private static TreeSet<String>                _unknownKeyTypeSet;
//==================================================================================================
public interface IITunesEventHandler extends EventHandler {
public void onITunesEvent(final ITunesEvent iTunesEvent);
} // interface IITunesEventHandler
//==================================================================================================
ITunesEvent(final EITunesEventType eventType, final String message, final int targetCount,
            final int completedCount, final TreeSet<String> unknownKeyTypeSet,
            final TreeSet<String> unknownKeyDataTypeSet) {
  _eventType = eventType;
  _message = message;
  _targetCount = targetCount;
  _completedCount = completedCount;
  _unknownKeyTypeSet = unknownKeyTypeSet;
  _unknownKeyDataTypeSet = unknownKeyDataTypeSet;
} // ITunesEvent()
//--------------------------------------------------------------------------------------------------
@Override
protected void dispatch(final IITunesEventHandler handler) {
  handler.onITunesEvent(this);
} // dispatch()
//--------------------------------------------------------------------------------------------------
@Override
public Type<IITunesEventHandler> getAssociatedType() {
  return ITunesEventType;
} // getAssociatedType()
//--------------------------------------------------------------------------------------------------
public int getCompletedCount() {
  return _completedCount;
} // getCompletedCount()
//--------------------------------------------------------------------------------------------------
public EITunesEventType getEventType() {
  return _eventType;
} // getEventType()
//--------------------------------------------------------------------------------------------------
public String getMessage() {
  return _message;
} // getMessage()
//--------------------------------------------------------------------------------------------------
public int getTargetCount() {
  return _targetCount;
} // getTargetCount()
//--------------------------------------------------------------------------------------------------
public static TreeSet<String> getUnknownKeyDataTypeSet() {
  return _unknownKeyDataTypeSet;
} // getUnknownKeyDataTypeSet()
//--------------------------------------------------------------------------------------------------
public static TreeSet<String> getUnknownKeyTypeSet() {
  return _unknownKeyTypeSet;
} // getUnknownKeyTypeSet()
//--------------------------------------------------------------------------------------------------
}